package com.jiyun.controller;

import com.jiyun.mapper.SafetyAssessMapper;
import com.jiyun.pojo.Orders;
import com.jiyun.pojo.SafetyAssess;
import com.jiyun.service.SafetyAssessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/safetyAssess")
public class SafetyAssessController {

    @Autowired
    public SafetyAssessMapper safetyAssessMapper;

    @Autowired
    public SafetyAssessService safetyAssessService;

    @GetMapping("/findAll")
    public List<SafetyAssess> findAll() {
        return safetyAssessMapper.selectList(null);
    }

    @GetMapping("/findStatus")
    public List<SafetyAssess> findStatus(@RequestParam("status") Integer status) {
        System.out.println("status = " + status);
        List<SafetyAssess> list = safetyAssessService.findStatus(status);
        return list;
    }
}